#pragma once
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <list>
#include <utility>
#define NDEF 0
#define FREE 2
#define BLOCKED 1
enum Direction {UP = 1, RIGHT = 2, DOWN = 4, LEFT = 8};			//rwx logic
enum Color {GREY, WHITE, BLACK};
enum Condition {NOT, HALF, READY};

using namespace std;

class Cell
{
	struct orientation
	{
		int **borders;
		int num_blocked;
		int num_free;
	} direction;
	

	struct  
	{
		int x, y;
	} pos;
	
	Condition condition;
	static const int N = 7;
	Color color;
	
public:
	Cell(int xxx, int yyy);
	Cell();
	~Cell(void);

	pair<int, int> getPos() const;
	void setPos(int x, int y);
	friend ostream& operator <<(ostream &, Cell p);
	friend ostream& operator <<(ostream &, Cell *p);
	void copyDirection(Direction, int * const);
	int setDirectionTo(pair<int, int>, const int state);
	//int setDirectionToFree(pair<int, int>);
	const orientation getDirection() const;
	pair<int, int> checkDirectionSwitch(const Color);
	const int getCondition() const;
	int setCondition(const int);
	friend int logar(int);
	void setColor(const Color);
	const Color getColor() const;
};